<?php
require("../../class/connect.php");
if(!defined('InEmpireCMS'))
{
	exit();
}
$myuserid=(int)getcvar('mluserid');
$mhavelogin=0;
if($myuserid)
{
	include("../../class/db_sql.php");
	include("../../class/user.php");
	include("../../data/dbcache/MemberLevel.php");
	$link=db_connect();
	$empire=new mysqlquery();
	$mhavelogin=1;
	//数据
	$myusername=RepPostVar(getcvar('mlusername'));
	$myrnd=RepPostVar(getcvar('mlrnd'));
	$r=$empire->fetch1("select ".$user_userid.",".$user_username.",".$user_group.",".$user_userfen.",".$user_money.",".$user_userdate.",".$user_havemsg.",".$user_checked." from ".$user_tablename." where ".$user_userid."='$myuserid' and ".$user_rnd."='$myrnd' limit 1");
	if(empty($r[$user_userid])||$r[$user_checked]==0)
	{
		EmptyEcmsCookie();
		$mhavelogin=0;
	}

	$addr=$empire->fetch1("select * from {$dbtbpre}enewsmemberadd where userid='".$myuserid."' limit 1");
		//头像
	$userhead=$addr['userpic']?$addr['userpic']:$public_r[newsurl].'e/data/images/nouserpic.gif';
	
	//会员等级
	if(empty($r[$user_group]))
	{$groupid=$user_groupid;}
	else
	{$groupid=$r[$user_group];}
	$groupname=$level_r[$groupid]['groupname'];
	//点数
	$userfen=$r[$user_userfen];
	//余额
	$money=$r[$user_money];
	//天数
	$userdate=0;
	if($r[$user_userdate])
	{
		$userdate=$r[$user_userdate]-time();
		if($userdate<=0)
		{$userdate=0;}
		else
		{$userdate=round($userdate/(24*3600));}
	}
	//是否有短信息
	$havemsg="";
	if($r[$user_havemsg])
	{
		$havemsg="<a href='".$public_r['newsurl']."e/member/msg/' target=_blank><font color=red>您有新信息</font></a>";
	}
	//$myusername=$r[$user_username];
	db_close();
	$empire=null;
}
if($mhavelogin==1)
{
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登陆</title>
<LINK href="../../data/images/qcss.css" rel=stylesheet>
</head>
<body bgcolor="#ededed" topmargin="0">
     <a href="/cms/em/e/member/register/ChangeRegister.php" class="register" style="background:#000;" title="立即注册体检"></a>
     <div class="title"><b><span style="font-weight:bold;color:#000">hi,</span><?=$myusername?></b></div>
   
<table class="user-panel" cellspacing='6' cellspadding='3'style="margin-top:10px">
<tr><td rowspan='2'><span><img src="/cms/em/e/data/images/nouserpic.gif" height="40"></span></td>
<td ><a target="_parent" href="/cms/em/e/member/my/">普通会员</a>&nbsp;</td>
<td ><a target="_blank" href="/cms/em/e/space/?userid=1">我的空间</a></td>
<tr><td ><a href="/cms/em/e/member/cp/" target="_parent">控制面板</a></td><td ><a href="/cms/em/e/enews/?enews=exit&ecmsfrom=9" onclick="return confirm('确认要退出?');">退出</a></td></tr>
</table></body>
</html>
<?
}
else
{
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登陆</title>
<LINK href="../../data/images/qcss.css" rel=stylesheet>
</head>
<body bgcolor="#ededed" topmargin="0">
<form name=login method=post action="/cms/em/e/enews/index.php">    
<a href="/cms/em/e/member/register/ChangeRegister.php" class="register" style="background:#000;" title="立即注册体检"></a>
     <div class="title"><b>登录</b><input type="button" class="btn"  value="登录" /><input type="checkbox" class="checkbox" />记住我</div>
     <ul>
       <li><input type="text" class="text" /><input  type="submit" value="登录" /></li>
       <li><input type="text" class="text" /><a href="#">忘记密码</a></li>
     </ul>
</form></body>
</html>

<?
}
?>